package cloud.eureka.ribbon.feign;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@EnableDiscoveryClient
@RestController
@RibbonClient("hello")
@EnableFeignClients
public class Application {
	
	@FeignClient("simple")
	interface HelloClient {
		@RequestMapping(value="/",method=RequestMethod.GET)
		String hello();
	}
	
	@Autowired
	HelloClient client;

	@RequestMapping("/")
	public String hello(){
		return client.hello();
	}
	
	public static void main(String[] args) {
		SpringApplication.run(Application.class, args);
	}
	
	
}
